#include<bits/stdc++.h>
using namespace std;
namespace MAOJUN{

const int N=1e5+5;
int n,m;char a[N],b[N];

int f[N],g[N];
inline void main(){
	scanf("%s%s",a+1,b+1);n=strlen(a+1);m=strlen(b+1);
	f[m+1]=n+1;
	for(int i=m;i;i--){
		f[i]=f[i+1]-1;
		while(f[i]&&a[f[i]]!=b[i])f[i]--;
		if(!f[i]){puts("NO");return;}
	}
	for(int i=1,j=1;i<=m;i++){
		g[i]=g[i-1]+1;
		while(j<f[i]&&(j<=g[i-1]+1||a[j]==a[j-1]))
			if(a[++j]==b[i])g[i]=j;
	}
	for(int i=g[m]+2;i<=n;i++)if(a[i]!=a[i-1]){puts("NO");return;}
	puts("YES");
	for(int i=1;i<=m;i++)printf("%d ",g[i]);
}

}int main(){
	freopen("seq.in","r",stdin);
	freopen("seq.out","w",stdout);
	MAOJUN::main();
	return 0;
}